import request from '@/api/axios'
import {AxiosPromise} from 'axios'
import {DataRecordList, DataRes, DictItemData} from '@/api/config'

import {Paging} from '@/api/config'
// 搜索信息
export interface GetUploadList  {
  checkupNo?: string | null //体检号
  personName?: string | null //用户姓名
  idNo?: string | null //身份证号
  operationTypeName?: string | null //操作类型
  gender?: string | null //性别
  age?: string | null //年龄
  uploadTime?: string | null //上传时间
  phyDate?: string|object | null //操作时间
  startPhyDate?: string | null //操作时间
  endPhyDate?: string | null //操作时间
  uploadName?: string | null //上传人
  uploadStatus?: number | null //上传状态

  ip?: string | null //ip
}


//分页数据
export interface RoleInfor extends GetUploadList {
  id: string
}

//分页
export const getUploadList = (
  params: GetUploadList&Paging
): AxiosPromise<DataRecordList<RoleInfor>> => {
  return request({
    url: '/api/dataUpload/selectDataPage',
    method: 'get',
    params
  })
}
// 上传/dataUpload/downloadData

export const downloadData = (
  params: GetUploadList&Paging
): AxiosPromise<DataRecordList<RoleInfor>> => {
  return request({
    url: '/api/dataUpload/downloadData',
    method: 'get',
    params
  })
}
// /dataUpload/uploadData  Array<string>
export const uploadData = (): AxiosPromise<DataRes<Array<string>>> => {
  return request({
    url: '/api/dataUpload/uploadData',
    method: 'post'
  })
}